//leecode练习；删除有序数组中的重复项
int removeDuplicates(int* nums, int numsSize)
{
    int* sur=nums;
    int* dst=nums+1;
    int count =numsSize-1;
    while(count--)
    {
        if(*sur==*dst)
        {
            dst++;
            numsSize--;
        }
        else
        {
            
            sur++;
            *sur=*dst;
            dst++;
        }
    }
    return numsSize;
}


//leecode练习：移出链表元素
struct ListNode* removeElements(struct ListNode* head, int val)
{
    //虚拟头结点p1
    struct ListNode*p1 = malloc(sizeof(struct ListNode));
	p1->next=head;
   
    struct ListNode*temp=p1;
    while(temp->next!=NULL)
    {
        if(temp->next->val!=val)
        {
            temp=temp->next;
        }
        else
        {
            temp->next=temp->next->next;
        }
    }
    return p1->next;
}
